var _ = require("lodash");
// _.countBy(collection, [iteratee=_.identity])
// 用来统计各个元素出现的次数
let a = _.countBy([6.1, 4.2, 6.3], Math.floor);
console.log(a);

let brr = [
  { name: "tom", age: "18" },
  { name: "tom2", age: "28" },
  { name: "tom3", age: "38" },
];
function test(o) {
  return o.name;
}
let b = _.countBy(brr, test);
console.log(b);
